import numpy as np
import matplotlib.pyplot as plt
temperature_str = np.loadtxt('demo.csv',delimiter=',',skiprows=1,usecols=(1),unpack=False,dtype=bytes)


temperature = np.ndarray(len(temperature_str))
for index in range(0,len(temperature_str)):
    item = temperature_str[index]
    if item != b'':
        item = item.decode('gb2312')
        item = float(item)

    else:
        item = None
    temperature[index] = item
print(temperature)

for index in range(len(temperature)):
    item = temperature[index]
    if item>= 500.0:
        item =  None
    temperature[index]=item

print(temperature)

t = np.arange(len(temperature))
plt.plot(t,temperature)
plt.plot(t,temperature,'pr')
plt.show()
